package org.example.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.domain.User;
import org.example.dto.UserDTO;
import org.example.dto.UserLoginDTO;
import org.example.dto.UserPageQueryDTO;
import org.example.vo.CapacityVo;
import org.example.vo.MaterialVo;
import org.example.vo.UserVO;

import java.util.List;

/**
* @author 19816
* @description 针对表【sys_user】的数据库操作Mapper
* @createDate 2024-05-22 14:08:03
* @Entity org.example.domain.User
*/
@Mapper
public interface UserMapper {
    @Select("select * from sys_user where username = #{username}")
    User getUser(UserLoginDTO user);

    Integer add(User user);

    Page<UserVO> listAll(UserPageQueryDTO userPageQueryDTO);

    boolean update(UserDTO userDTO);

    void deleteUser(Integer id);

    @Select("select nickname from sys_user where id = #{id}")
    String getUserName(String id);

    List<CapacityVo> getCapacity();

    List<MaterialVo> getMaterial();
}




